﻿<phone:PhoneApplicationPage
  x:Class="Renren.Pages.PhotoPage"
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
  xmlns:controls="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls"
  xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
  xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  xmlns:controlsPrimitives="clr-namespace:Microsoft.Phone.Controls.Primitives;assembly=Microsoft.Phone.Controls"
  d:DataContext="{d:DesignData /SampleData/PhotosViewModel.xaml}"
  SupportedOrientations="Portrait" Orientation="Portrait"
  mc:Ignorable="d" d:DesignHeight="800" d:DesignWidth="480"
  shell:SystemTray.IsVisible="False">

  <!--LayoutRoot is the root grid where all page content is placed-->
  <Grid x:Name="LayoutRoot" Background="Transparent">
    <Grid.RowDefinitions>
      <RowDefinition Height="*"/>
    </Grid.RowDefinitions>

    <!--ContentPanel - place additional content here-->
    <Grid x:Name="ContentPanel">
      <ListBox x:Name="PhotoListBox"
               ItemsSource="{Binding PhotoList}"
               Width="510"
               ScrollViewer.HorizontalScrollBarVisibility="Auto">
        <ListBox.Resources>
          <Style x:Key="PhotoListBox" TargetType="ListBox">
            <Setter Property="Template">
              <Setter.Value>
                <ControlTemplate TargetType="ListBox">
                  <ScrollViewer ScrollViewer.HorizontalScrollBarVisibility="Auto"
                                ScrollViewer.VerticalScrollBarVisibility="Disabled"
                                ManipulationCompleted="ScrollViewer_ManipulationCompleted"
                                ManipulationStarted="ScrollViewer_ManipulationStarted"
                                MouseMove="ScrollViewer_MouseMove"
                                ManipulationMode="Control">
                    <ItemsPresenter/>
                  </ScrollViewer>
                </ControlTemplate>
              </Setter.Value>
            </Setter>
          </Style>
        </ListBox.Resources>
        <ListBox.Style>
          <StaticResource ResourceKey="PhotoListBox"/>
        </ListBox.Style>
        <ListBox.ItemsPanel>
          <ItemsPanelTemplate>
            <StackPanel Orientation="Horizontal"/>
          </ItemsPanelTemplate>
        </ListBox.ItemsPanel>
        <ListBox.ItemTemplate>
          <DataTemplate>
            <StackPanel Height="800" Orientation="Horizontal">
              <Image x:Name="PhotoImage" Source="{Binding UrlLarge}" Width="480"/>
              <Rectangle x:Name="PhotoMargin" Width="30"/>
            </StackPanel>
          </DataTemplate>
        </ListBox.ItemTemplate>
      </ListBox>
    </Grid>
  </Grid>

</phone:PhoneApplicationPage>
